<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.0.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/website/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/website/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/website/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/website/images/logo.svg" color="#222">
  <link rel="alternate" href="/website/atom.xml" title="徐良军" type="application/atom+xml">



<link rel="stylesheet" href="/website/css/main.css">


<link rel="stylesheet" href="/website/lib/font-awesome/css/font-awesome.min.css">


<script id="hexo-configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/website/',
    scheme: 'Gemini',
    version: '7.5.0',
    exturl: false,
    sidebar: {"position":"left","display":"post","offset":12,"onmobile":false},
    copycode: {"enable":false,"show_result":false,"style":null},
    back2top: {"enable":true,"sidebar":false,"scrollpercent":true},
    bookmark: {"enable":false,"color":"#222","save":"auto"},
    fancybox: false,
    mediumzoom: false,
    lazyload: false,
    pangu: false,
    algolia: {
      appID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    },
    localsearch: {"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},
    path: 'search.xml',
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    translation: {
      copy_button: '复制',
      copy_success: '复制成功',
      copy_failure: '复制失败'
    },
    sidebarPadding: 40
  };
</script>

  <meta name="description" content="如果你也想要跟我一样自己撘一个个人博客系统，但又不知道怎么做，那么恭喜你！看完这篇文章，你也可以像我一样搭建一个属于自己的博客了！Come on！">
<meta name="keywords" content="-建站 -创建博客">
<meta property="og:type" content="article">
<meta property="og:title" content="码云 + Hexo 搭建个人博客">
<meta property="og:url" content="https:&#x2F;&#x2F;ahxuliangjun.gitee.io&#x2F;website&#x2F;2019&#x2F;11&#x2F;07&#x2F;1&#x2F;index.html">
<meta property="og:site_name" content="徐良军">
<meta property="og:description" content="如果你也想要跟我一样自己撘一个个人博客系统，但又不知道怎么做，那么恭喜你！看完这篇文章，你也可以像我一样搭建一个属于自己的博客了！Come on！">
<meta property="og:locale" content="zh-CN">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;1.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;2.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;3.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;4.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;5.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;6.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;7.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;8.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;9.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;10.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;11.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;12.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;13.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;14.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;15.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;16.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;17.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;18.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;19.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;20.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;21.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;22.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;23.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;24.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;25.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;26.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;27.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;28.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;29.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;30.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;31.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;32.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;33.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;34.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;35.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;36.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;37.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;38.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;39.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;40.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;41.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;42.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;43.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;44.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;45.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;46.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;47.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;48.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;49.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;50.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;51.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;52.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;53.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;54.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;55.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;56.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;57.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;58.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;59.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;60.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;61.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;62.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;63.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;64.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;65.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;66.jpeg">
<meta property="og:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;67.jpeg">
<meta property="og:updated_time" content="2019-11-15T07:30:57.425Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http:&#x2F;&#x2F;q0sn9so75.bkt.clouddn.com&#x2F;1.jpeg">

<link rel="canonical" href="https://ahxuliangjun.gitee.io/website/2019/11/07/1/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome: false,
    isPost: true,
    isPage: false,
    isArchive: false
  };
</script>

  <title>码云 + Hexo 搭建个人博客 | 徐良军</title>
  


  <script>
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?af6a4283c9604d2328cad2de26b72836";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>




  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

  <!-- weather css -->
  <style type="text/css">
	  #tp-weather-widget .sw-container {
	    left: 10px;
	    right: unset;
	    top: unset;
	    bottom: 10px;
	  }
  </style>
</head>

<body itemscope itemtype="http://schema.org/WebPage" style="background:url(https://ahxuliangjun.gitee.io/website/images/bg.jpeg);">
  <div class="container use-motion">
    <div class="headband"></div>
<a href="https://gitee.com/ahxuliangjun" target="_blank" rel="noopener" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#70B7FD; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-meta">

    <div>
      <a href="/website/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">徐良军</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
        <p class="site-subtitle">徐良军的博客</p>
  </div>

  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>
</div>


<nav class="site-nav">
  
  <ul id="menu" class="menu">
        <li class="menu-item menu-item-home">

    <a href="/website/" rel="section"><i class="fa fa-fw fa-home"></i>首页</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/website/categories/" rel="section"><i class="fa fa-fw fa-th"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/website/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>归档</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>

</nav>
  <div class="site-search">
    <div class="popup search-popup">
    <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocorrect="off" autocapitalize="none"
           placeholder="搜索..." spellcheck="false"
           type="text" id="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result"></div>

</div>
<div class="search-pop-overlay"></div>

  </div>
</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content">
            

  <div class="posts-expand">
      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block " lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://ahxuliangjun.gitee.io/website/website/2019/11/07/1/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="https://himg.bdimg.com/sys/portrait/item/pp.1.d8a0b964.z9ewrAT61w4xKYPMXSO_9g?_t=1573118862410">
      <meta itemprop="name" content="徐良军">
      <meta itemprop="description" content="故其疾如风，其徐如林，侵掠如火，不动如山">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="徐良军">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          码云 + Hexo 搭建个人博客
        </h1>

        <div class="post-meta">
          
            <i class="fa fa-thumb-tack"></i>
            <font color=ff6800>置顶</font>
            <span class="post-meta-divider">|</span>
          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2019-11-07 17:12:17" itemprop="dateCreated datePublished" datetime="2019-11-07T17:12:17+08:00">2019-11-07</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2019-11-15 15:30:57" itemprop="dateModified" datetime="2019-11-15T15:30:57+08:00">2019-11-15</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/website/categories/%E5%BB%BA%E7%AB%99%E5%AD%A6%E4%B9%A0/" itemprop="url" rel="index">
                    <span itemprop="name">建站学习</span>
                  </a>
                </span>
            </span>

          
            <div class="post-description">如果你也想要跟我一样自己撘一个个人博客系统，但又不知道怎么做，那么恭喜你！看完这篇文章，你也可以像我一样搭建一个属于自己的博客了！Come on！</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <blockquote>
<p>版权声明：本文为博主原创文章，遵循 CC 4.0 BY-SA 版权协议，转载请附上原文出处链接和本声明。<br>本文链接：<a href="https://blog.csdn.net/weidong_y/article/details/90904781" target="_blank" rel="noopener">https://blog.csdn.net/weidong_y/article/details/90904781</a></p>
</blockquote><h2 id="准备环境"><a href="#准备环境" class="headerlink" title="准备环境"></a>准备环境</h2><p>1.安装 Node<br>2.安装 Git<br>3.注册码云<br>4.安装 Hexo</p><a id="more"></a>

<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ npm install hexo-cli -g</span><br></pre></td></tr></table></figure>

<p><img src="http://q0sn9so75.bkt.clouddn.com/1.jpeg" alt title="图片1"></p>
<p>##搭建本地个人博客</p>
<p>###初始化 hexo</p>
<ul>
<li>新建一个空白文件夹（下文提到的“项目根目录”是指你新建的文件夹的位置）用于存放 hexo 资源。在空白文件夹里面打开 Git Bash ，输入下列命令行进行初始化，初始化成功后会在文件夹生成如下图的文件。</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo init</span><br></pre></td></tr></table></figure>

<p><img src="http://q0sn9so75.bkt.clouddn.com/2.jpeg" alt title="图2"></p>
<h3 id="生成静态页面"><a href="#生成静态页面" class="headerlink" title="生成静态页面"></a>生成静态页面</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo g</span><br></pre></td></tr></table></figure>

<h3 id="启动本地服务"><a href="#启动本地服务" class="headerlink" title="启动本地服务"></a>启动本地服务</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo s</span><br></pre></td></tr></table></figure>
<ul>
<li>关闭本地服务器在 Git Bash 界面按 Ctrl+C， 在浏览器输入：<a href="http://localhost:4000" target="_blank" rel="noopener">http://localhost:4000</a> 查看</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/3.jpeg" alt title="图片3"></p>
<h2 id="美化个人博客"><a href="#美化个人博客" class="headerlink" title="美化个人博客"></a>美化个人博客</h2><h3 id="博客主题设置"><a href="#博客主题设置" class="headerlink" title="博客主题设置"></a>博客主题设置</h3><h4 id="克隆主题"><a href="#克隆主题" class="headerlink" title="克隆主题"></a>克隆主题</h4><ul>
<li>在项目根目录下的 themes 文件中，打开 Git Bash ，用命令行克隆下新的主题。我这里用的 Next 主题，需要其他主题的自己百度找。</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ git <span class="built_in">clone</span> https://github.com/theme-next/hexo-theme-next.git</span><br></pre></td></tr></table></figure>
<p><img src="http://q0sn9so75.bkt.clouddn.com/4.jpeg" alt title="图片4"></p>
<h4 id="配置主题"><a href="#配置主题" class="headerlink" title="配置主题"></a>配置主题</h4><ul>
<li>用文本的方式打开项目根目录下的_config.yml 配置文件，找到theme把原来默认的landscape主题名字，改成刚刚克隆的主题名字（主题名字为上图中文件夹的名字）</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/5.jpeg" alt title="图片5"></p>
<h4 id="测试主题"><a href="#测试主题" class="headerlink" title="测试主题"></a>测试主题</h4><ul>
<li>重新回到项目根目录下，打开 Git Bath ，用命令行启动服务器。在浏览器访问 <a href="http://localhost:4000" target="_blank" rel="noopener">http://localhost:4000</a></li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/6.jpeg" alt title="图片6"></p>
<h4 id="发布文章"><a href="#发布文章" class="headerlink" title="发布文章"></a>发布文章</h4><ul>
<li>方法一：在项目根目录下，打开 Git Bash ，执行新建命令，然后 hexo 会自动在指定目录下生成对应文件，如下图所示。然后找到新建好的文件，打开即可进行编辑。</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo new <span class="string">"此处输入文章名字"</span></span><br></pre></td></tr></table></figure>

<p><img src="http://q0sn9so75.bkt.clouddn.com/7.jpeg" alt title="图片7"></p>
<ul>
<li><p>方法二:可以直接把已经准备的 md 格式的文章复制到 项目名称/source/_posts 目录下，然后打开文件，在文件头加入front-matter 部分，title 表示文章标题，date 表示发布时间。如图所示，图片上用到的其他参数，后面会介绍到。</p>
</li>
<li><p><font color="red">重要的事情说三遍！！！</font></p>
</li>
<li><p>front-matte 书写的时候要注意，冒号后面要跟一个空格号。</p>
</li>
<li><p>front-matte 书写的时候要注意，冒号后面要跟一个空格号。</p>
</li>
<li><p>front-matte 书写的时候要注意，冒号后面要跟一个空格号。</p>
</li>
</ul>
<figure class="highlight makefile"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">---</span><br><span class="line"><span class="section">title: a</span></span><br><span class="line"><span class="section">date: 2019-04-14 23:10:17</span></span><br><span class="line">---</span><br></pre></td></tr></table></figure>
<p><img src="http://q0sn9so75.bkt.clouddn.com/8.jpeg" alt title="图片8"></p>
<ul>
<li>准备好 md 格式文件后，使用下面命令生成网站静态文件到默认设置的 public 文件夹，然后再启动本地服务器。</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo g</span><br></pre></td></tr></table></figure>

<p>###主题风格设置</p>
<p><strong>打开主题文件夹下的 _config.yml 配置文件（注意：这里要区别，不是項目根目录，主题文件夹的路径为：新建空白文件夹名称/themes/主题文件夹名称）。通过查找功能找到 **Schemes</strong> 模块，修改为 <strong>Gemini</strong> 风格。如果喜欢其他风格可以自己修改。如下图所示：</p>
<p><img src="http://q0sn9so75.bkt.clouddn.com/9.jpeg" alt title="图片9"></p>
<ul>
<li>刷新页面可以看到新风格的界面如下图所示：</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/10.jpeg" alt title="图片10"></p>
<h3 id="博客左侧栏设置"><a href="#博客左侧栏设置" class="headerlink" title="博客左侧栏设置"></a>博客左侧栏设置</h3><ul>
<li>在上面的网站界面，可以发现网站的文字是英文，只要修改一下语言模式即可。打开根目录文件夹下的 _config.yml 配置文件。找到 language，设置为 zh-CN。标题等其他参数的设置如下。可以对照效果图的具体位置，根据自己的实际需求进行修改。（注意：修改了项目根目录下的 _config.yml配置文件，需要重启部署项目后才能生效）</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/11.jpeg" alt title="图片11"></p>
<p><img src="http://q0sn9so75.bkt.clouddn.com/12.jpeg" alt title="图片12"></p>
<h3 id="分类设置"><a href="#分类设置" class="headerlink" title="分类设置"></a>分类设置</h3><h4 id="添加分类列表"><a href="#添加分类列表" class="headerlink" title="添加分类列表"></a>添加分类列表</h4><ul>
<li>在项目根目录下，执行下面的命令行，新建分类页面，然后会在项目根目录下的 <strong>source</strong> 文件夹中新建一个 <strong>categories</strong> 文件夹。</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo new page categories</span><br></pre></td></tr></table></figure>

<p><img src="http://q0sn9so75.bkt.clouddn.com/13.jpeg" alt title="图片13"></p>
<ul>
<li>打开 <strong>categories</strong> 文件夹中的 <strong>index.md</strong> 文件，添加 <strong>type</strong> 字段，设置为 <strong>“categories”</strong>。如下图所示。</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/14.jpeg" alt title="图片14"></p>
<ul>
<li>接着到主题文件夹下的 _config.yml 配置文件下，找到 <strong>menu</strong> 模块，把 <strong>categories</strong> 的注释给去掉。如下图所示。</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/15.jpeg" alt title="图片15"></p>
<ul>
<li><p>刷新页面（如果刷新没效果，可以重启服务），可以在页面左侧栏上看到多了一个“分类”列表。</p>
<p><img src="http://q0sn9so75.bkt.clouddn.com/16.jpeg" alt title="图片16"></p>
</li>
</ul>
<h4 id="如何将文章添加到对应分类？"><a href="#如何将文章添加到对应分类？" class="headerlink" title="如何将文章添加到对应分类？"></a>如何将文章添加到对应分类？</h4><ul>
<li>文章发布前，在 front-matter 部分，多写一个 categories 字段，然后参数写上类别的名称，保存后重启服务，在网页上点击“分类”，可以看到分类下已经生成了刚刚设置的类别，并把刚刚发布的文章归类在此类别下。如下图所示。<br>[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-9gWMcfIn-1571454072700)(<a href="http://zwd.yyzheng.cn/hexo_manong_blog/9c256cae759cdcffs.png)]" target="_blank" rel="noopener">http://zwd.yyzheng.cn/hexo_manong_blog/9c256cae759cdcffs.png)]</a></li>
</ul>
<h3 id="标签设置"><a href="#标签设置" class="headerlink" title="标签设置"></a>标签设置</h3><ul>
<li><p>方法跟分类设置一样，所以不再赘述介绍。</p>
</li>
<li><p>但是需要补充一点， front-matter 中字段有多个参数的时候，可以使用如下图的写法。</p>
<p><img src="http://q0sn9so75.bkt.clouddn.com/17.jpeg" alt title="图片17"></p>
</li>
</ul>
<h3 id="Hexo-博客添加站内搜索"><a href="#Hexo-博客添加站内搜索" class="headerlink" title="Hexo 博客添加站内搜索"></a>Hexo 博客添加站内搜索</h3><ul>
<li><p>NexT主题支持集成 <strong>Swiftype</strong>、 微搜索、<strong>Local Search</strong> 和 <strong>Algolia</strong>。下面介绍 <strong>Local Search</strong> 的安装吧。注意：安装的时候要是项目根目录下安装。</p>
</li>
<li><p>安装 hexo-generator-search</p>
</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ npm install hexo-generator-search --save</span><br></pre></td></tr></table></figure>

<ul>
<li>安装 hexo-generator-searchdb</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ npm install hexo-generator-searchdb --save</span><br></pre></td></tr></table></figure>

<ul>
<li>在项目根目录下的 _config.yml 配置文件的文末添加下面这段代码。</li>
</ul>
<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">search:</span></span><br><span class="line">  <span class="attr">path:</span> <span class="string">search.xml</span></span><br><span class="line">  <span class="attr">field:</span> <span class="string">post</span></span><br><span class="line">  <span class="attr">format:</span> <span class="string">html</span></span><br><span class="line">  <span class="attr">limit:</span> <span class="number">10000</span></span><br></pre></td></tr></table></figure>

<ul>
<li>编辑主题文件夹的 _config.yml 配置文件，设置 Local searchenable 为 <strong>ture</strong>。</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/18.jpeg" alt title="图片18"></p>
<ul>
<li>重启服务，效果图如下：</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/19.jpeg" alt title="图片19"></p>
<h3 id="博客头像设置"><a href="#博客头像设置" class="headerlink" title="博客头像设置"></a>博客头像设置</h3><h4 id="添加博客头像"><a href="#添加博客头像" class="headerlink" title="添加博客头像"></a>添加博客头像</h4><ul>
<li>打开主题文件夹下的 _config.yml 配置文件，通过查找功能找到 <strong>avatar</strong>，然后把一个在线的头像图片地址（百度图片中直接复制链接即可），作为 <strong>url</strong> 的参数。如下图所示：</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/20.jpeg" alt title="图片20"></p>
<ul>
<li>然后刷新页面，可以看到网站上已经显示了相应的头像了：</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/21.jpeg" alt title="图片21"></p>
<h4 id="设置头像圆角并旋转打开"><a href="#设置头像圆角并旋转打开" class="headerlink" title="设置头像圆角并旋转打开"></a>设置头像圆角并旋转打开</h4><ul>
<li>打开主题文件夹的 source\css_common\components\sidebar 目录下的 sidebar-author.styl 文件，然后把下面的代码添加进去即可。</li>
</ul>
<figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-class">.site-author-image</span> &#123;</span><br><span class="line">  <span class="attribute">display</span>: block;</span><br><span class="line">  <span class="attribute">margin</span>: <span class="number">0</span> auto;</span><br><span class="line">  <span class="attribute">padding</span>: $site-author-image-padding;</span><br><span class="line">  <span class="attribute">max-width</span>: $site-author-image-width;</span><br><span class="line">  <span class="attribute">height</span>: $site-author-image-height;</span><br><span class="line">  <span class="attribute">border</span>: $site-author-image-border-width solid $site-author-image-border-color;</span><br><span class="line">  <span class="comment">/* 头像圆形 */</span></span><br><span class="line">  <span class="attribute">border-radius</span>: <span class="number">80px</span>;</span><br><span class="line">  <span class="attribute">-webkit-border-radius</span>: <span class="number">80px</span>;</span><br><span class="line">  <span class="attribute">-moz-border-radius</span>: <span class="number">80px</span>;</span><br><span class="line">  <span class="attribute">box-shadow</span>: inset <span class="number">0</span> -<span class="number">1px</span> <span class="number">0</span> <span class="number">#333</span>sf;</span><br><span class="line">  <span class="comment">/* 设置循环动画 [animation: (play)动画名称 (2s)动画播放时长单位秒或微秒 (ase-out)动画播放的速度曲线为以低速结束 </span></span><br><span class="line"><span class="comment">    (1s)等待1秒然后开始动画 (1)动画播放次数(infinite为循环播放) ]*/</span></span><br><span class="line"> </span><br><span class="line">  <span class="comment">/* 鼠标经过头像旋转360度 */</span></span><br><span class="line">  <span class="attribute">-webkit-transition</span>: -webkit-transform <span class="number">1.0s</span> ease-out;</span><br><span class="line">  <span class="attribute">-moz-transition</span>: -moz-transform <span class="number">1.0s</span> ease-out;</span><br><span class="line">  <span class="attribute">transition</span>: transform <span class="number">1.0s</span> ease-out;</span><br><span class="line">&#125;</span><br><span class="line"><span class="selector-tag">img</span><span class="selector-pseudo">:hover</span> &#123;</span><br><span class="line">  <span class="comment">/* 鼠标经过停止头像旋转 </span></span><br><span class="line"><span class="comment">  -webkit-animation-play-state:paused;</span></span><br><span class="line"><span class="comment">  animation-play-state:paused;*/</span></span><br><span class="line">  <span class="comment">/* 鼠标经过头像旋转360度 */</span></span><br><span class="line">  <span class="attribute">-webkit-transform</span>: <span class="built_in">rotateZ</span>(360deg);</span><br><span class="line">  <span class="attribute">-moz-transform</span>: <span class="built_in">rotateZ</span>(360deg);</span><br><span class="line">  <span class="attribute">transform</span>: <span class="built_in">rotateZ</span>(360deg);</span><br><span class="line">&#125;</span><br><span class="line"><span class="comment">/* Z 轴旋转动画 */</span></span><br><span class="line">@-<span class="keyword">webkit</span>-<span class="keyword">keyframes</span> play &#123;</span><br><span class="line">  0% &#123;</span><br><span class="line">    <span class="attribute">-webkit-transform</span>: <span class="built_in">rotateZ</span>(0deg);</span><br><span class="line">  &#125;</span><br><span class="line">  100% &#123;</span><br><span class="line">    <span class="attribute">-webkit-transform</span>: <span class="built_in">rotateZ</span>(-360deg);</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br><span class="line">@-<span class="keyword">moz</span>-<span class="keyword">keyframes</span> play &#123;</span><br><span class="line">  0% &#123;</span><br><span class="line">    <span class="attribute">-moz-transform</span>: <span class="built_in">rotateZ</span>(0deg);</span><br><span class="line">  &#125;</span><br><span class="line">  100% &#123;</span><br><span class="line">    <span class="attribute">-moz-transform</span>: <span class="built_in">rotateZ</span>(-360deg);</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br><span class="line">@<span class="keyword">keyframes</span> play &#123;</span><br><span class="line">  0% &#123;</span><br><span class="line">    <span class="attribute">transform</span>: <span class="built_in">rotateZ</span>(0deg);</span><br><span class="line">  &#125;</span><br><span class="line">  100% &#123;</span><br><span class="line">    <span class="attribute">transform</span>: <span class="built_in">rotateZ</span>(-360deg);</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<ul>
<li>效果图如下：</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/22.jpeg" alt title="图片22"></p>
<h3 id="右上角-fork-me-设置"><a href="#右上角-fork-me-设置" class="headerlink" title="右上角 fork me 设置"></a>右上角 fork me 设置</h3><ul>
<li>在 <a href="http://tholman.com/github-corners/" target="_blank" rel="noopener">GitHub Corners</a> 上选择你喜欢的挂饰，复制方框内的代码。</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/23.jpeg" alt title="图片23"></p>
<ul>
<li>打开主题文件夹下的 layout 文件夹，用记事本的方式打开_layout.swig，把刚刚复制的代码放到下面，并把 <strong>href</strong> 的参数，修改为自己的 github 链接（放自己要跳转的网址即可）。</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/24.jpeg" alt title="图片24"></p>
<ul>
<li>重启服务器，查看效果图：</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/25.jpeg" alt title="图片25"></p>
<h3 id="网页背景设置"><a href="#网页背景设置" class="headerlink" title="网页背景设置"></a>网页背景设置</h3><h4 id="动态背景设置"><a href="#动态背景设置" class="headerlink" title="动态背景设置"></a>动态背景设置</h4><ul>
<li>打开主题文件夹下的 <strong>layout</strong> 文件夹，用文本的方式打开 <strong>_layout.swig</strong> 文件，在文末加上如下的代码：</li>
</ul>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">&lt;!-- 动态背景 --&gt;</span><br><span class="line">&lt;script type=<span class="string">"text/javascript"</span> src=<span class="string">"//cdn.bootcss.com/canvas-nest.js/1.0.0/canvas-nest.min.js"</span>&gt;<span class="xml"><span class="tag">&lt;/<span class="name">script</span>&gt;</span></span></span><br></pre></td></tr></table></figure>

<h4 id="背景图片设置"><a href="#背景图片设置" class="headerlink" title="背景图片设置"></a>背景图片设置</h4><ul>
<li>打开主题文件夹下的 <strong>source</strong> 文件夹，进入 <strong>css/_custom</strong> 文件下，用文本形式打开 <strong>custom.styl</strong> 文件，然后添加下面这段代码。代码中 <strong>url</strong> 的地址是指到： 主题文件夹/source/images/ 。</li>
</ul>
<figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-tag">body</span>&#123;</span><br><span class="line">    <span class="attribute">background</span>:<span class="built_in">url</span>(/images/bg.jpg);</span><br><span class="line">    <span class="attribute">background-size</span>:cover;</span><br><span class="line">    <span class="attribute">background-repeat</span>:no-repeat;</span><br><span class="line">    <span class="attribute">background-attachment</span>:fixed;</span><br><span class="line">    <span class="attribute">background-position</span>:center;</span><br><span class="line">    // 设置主题部分的透明度，具体看图</span><br><span class="line">    <span class="selector-tag">opacity</span>: 0<span class="selector-class">.8</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<ul>
<li>效果图如下：</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/26.jpeg" alt title="图片26"></p>
<h3 id="点击出现桃心效果设置"><a href="#点击出现桃心效果设置" class="headerlink" title="点击出现桃心效果设置"></a>点击出现桃心效果设置</h3><ul>
<li>在主题文件夹下的 source\js 目录下新建一个 src 文件夹，在 <strong>src</strong> 文件中，新建一个 <strong>clicklove.js</strong> 文件，然后把下面的代码复制进去。</li>
</ul>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">!<span class="function"><span class="keyword">function</span>(<span class="params">e,t,a</span>)</span>&#123;<span class="function"><span class="keyword">function</span> <span class="title">n</span>(<span class="params"></span>)</span>&#123;c(<span class="string">".heart&#123;width: 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);&#125;.heart:after,.heart:before&#123;content: '';width: inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: fixed;&#125;.heart:after&#123;top: -5px;&#125;.heart:before&#123;left: -5px;&#125;"</span>),o(),r()&#125;<span class="function"><span class="keyword">function</span> <span class="title">r</span>(<span class="params"></span>)</span>&#123;<span class="keyword">for</span>(<span class="keyword">var</span> e=<span class="number">0</span>;e&lt;d.length;e++)d[e].alpha&lt;=<span class="number">0</span>?(t.body.removeChild(d[e].el),d.splice(e,<span class="number">1</span>)):(d[e].y--,d[e].scale+=<span class="number">.004</span>,d[e].alpha-=<span class="number">.013</span>,d[e].el.style.cssText=<span class="string">"left:"</span>+d[e].x+<span class="string">"px;top:"</span>+d[e].y+<span class="string">"px;opacity:"</span>+d[e].alpha+<span class="string">";transform:scale("</span>+d[e].scale+<span class="string">","</span>+d[e].scale+<span class="string">") rotate(45deg);background:"</span>+d[e].color+<span class="string">";z-index:99999"</span>);requestAnimationFrame(r)&#125;<span class="function"><span class="keyword">function</span> <span class="title">o</span>(<span class="params"></span>)</span>&#123;<span class="keyword">var</span> t=<span class="string">"function"</span>==<span class="keyword">typeof</span> e.onclick&amp;&amp;e.onclick;e.onclick=<span class="function"><span class="keyword">function</span>(<span class="params">e</span>)</span>&#123;t&amp;&amp;t(),i(e)&#125;&#125;<span class="function"><span class="keyword">function</span> <span class="title">i</span>(<span class="params">e</span>)</span>&#123;<span class="keyword">var</span> a=t.createElement(<span class="string">"div"</span>);a.className=<span class="string">"heart"</span>,d.push(&#123;<span class="attr">el</span>:a,<span class="attr">x</span>:e.clientX<span class="number">-5</span>,<span class="attr">y</span>:e.clientY<span class="number">-5</span>,<span class="attr">scale</span>:<span class="number">1</span>,<span class="attr">alpha</span>:<span class="number">1</span>,<span class="attr">color</span>:s()&#125;),t.body.appendChild(a)&#125;<span class="function"><span class="keyword">function</span> <span class="title">c</span>(<span class="params">e</span>)</span>&#123;<span class="keyword">var</span> a=t.createElement(<span class="string">"style"</span>);a.type=<span class="string">"text/css"</span>;<span class="keyword">try</span>&#123;a.appendChild(t.createTextNode(e))&#125;<span class="keyword">catch</span>(t)&#123;a.styleSheet.cssText=e&#125;t.getElementsByTagName(<span class="string">"head"</span>)[<span class="number">0</span>].appendChild(a)&#125;<span class="function"><span class="keyword">function</span> <span class="title">s</span>(<span class="params"></span>)</span>&#123;<span class="keyword">return</span><span class="string">"rgb("</span>+~~(<span class="number">255</span>*<span class="built_in">Math</span>.random())+<span class="string">","</span>+~~(<span class="number">255</span>*<span class="built_in">Math</span>.random())+<span class="string">","</span>+~~(<span class="number">255</span>*<span class="built_in">Math</span>.random())+<span class="string">")"</span>&#125;<span class="keyword">var</span> d=[];e.requestAnimationFrame=<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;<span class="keyword">return</span> e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.oRequestAnimationFrame||e.msRequestAnimationFrame||<span class="function"><span class="keyword">function</span>(<span class="params">e</span>)</span>&#123;setTimeout(e,<span class="number">1e3</span>/<span class="number">60</span>)&#125;&#125;(),n()&#125;(<span class="built_in">window</span>,<span class="built_in">document</span>);</span><br></pre></td></tr></table></figure>

<ul>
<li>接着，打开主题文件下的 layout 文件夹，用文本的方式打开 <strong>_layout.swig</strong> 文件，在文末加上如下的代码：</li>
</ul>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">&lt;!-- 页面点击小红心 --&gt;</span><br><span class="line">&lt;script type=<span class="string">"text/javascript"</span> src=<span class="string">"/js/src/clicklove.js"</span>&gt;<span class="xml"><span class="tag">&lt;/<span class="name">script</span>&gt;</span></span></span><br></pre></td></tr></table></figure>

<ul>
<li>重新部署项目即可看到点击效果如下：</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/27.jpeg" alt title="图片27"></p>
<h3 id="首页文章预览设置"><a href="#首页文章预览设置" class="headerlink" title="首页文章预览设置"></a>首页文章预览设置</h3><ul>
<li><p>默认情况下，文章在首页是全文显示的，这样肯定是不方便读者浏览。所以需要实现预览模式。效果图如下：<br>[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-qRaw0uB3-1571454072742)(<a href="http://zwd.yyzheng.cn/hexo_manong_blog/5e832db322ee611es.png)]" target="_blank" rel="noopener">http://zwd.yyzheng.cn/hexo_manong_blog/5e832db322ee611es.png)]</a></p>
</li>
<li><p><strong>方法一</strong>：使用 <strong>&lt; !–more–&gt;</strong> 手动切断<br>这种方法可以根据文章的内容，自己在合适的位置添加 &lt; !–more–&gt; 标签，使用灵活，也是Hexo推荐的方法。</p>
</li>
<li><p><strong>方法二</strong>：添加 description<br>在文章的 front-matter 中添加 description 和 photos 字段，如下图所示。如果不需要显示图片的话，可以把 photos 去掉。<br>ps：不知道 front-matter 是什么的话，跳转到第二章的第4点的发布文章看下。</p>
</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/28.jpeg" alt title="图片28"></p>
<ul>
<li><strong>方法三</strong>：自动形成摘要<br>在主题文件下的 _config.yml 配置文件中添加默认截取的长度为 150 字符，可以根据需要自行设定。</li>
</ul>
<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">auto_excerpt:</span></span><br><span class="line">  <span class="attr">enable:</span> <span class="literal">true</span></span><br><span class="line">  <span class="attr">length:</span> <span class="number">150</span></span><br></pre></td></tr></table></figure>

<h3 id="RSS-设置"><a href="#RSS-设置" class="headerlink" title="RSS 设置"></a>RSS 设置</h3><ul>
<li>安装 hexo 插件，需要在 hexo 项目根目录下进行安装。</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ npm install --save hexo-generator-feed</span><br></pre></td></tr></table></figure>

<ul>
<li>安装完成后在项目根目录下的 _config.yml 配置文件的文末添加下面这段代码：</li>
</ul>
<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># Extensions</span></span><br><span class="line"><span class="comment">## Plugins: http://hexo.io/plugins/</span></span><br><span class="line"><span class="attr">plugins:</span> <span class="string">hexo-generate-feed</span></span><br></pre></td></tr></table></figure>

<ul>
<li>在主题文件夹下的 _config.yml 配置文件中，找到 <strong>rss</strong> ，在后面加上 <strong>/atom.xml</strong>。如下图所示：</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/29.jpeg" alt title="图片29"></p>
<ul>
<li>重启服务，刷新页面可以看到如下效果图：</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/30.jpeg" alt title="图片30"></p>
<h3 id="社交小图标设置"><a href="#社交小图标设置" class="headerlink" title="社交小图标设置"></a>社交小图标设置</h3><ul>
<li><p>在主题文件夹下的 _config.yml 配置文件中，搜索 <strong>Social</strong>，然后提示自己增加自己需要的小图标并设置对应连接。</p>
</li>
<li><p>图标可以到 <a href="https://fontawesome.com/icons?from=io" target="_blank" rel="noopener">Font Awesome Icon</a> 网站查找。</p>
</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/31.jpeg" alt title="图片31"></p>
<ul>
<li>效果图如下：</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/32.jpeg" alt title="图片32"></p>
<h3 id="友情链接设置"><a href="#友情链接设置" class="headerlink" title="友情链接设置"></a>友情链接设置</h3><ul>
<li>在主题文件夹下的 _config.yml 配置文件中，搜索 <strong>links_title</strong>，然后根据自己的需求自己吸修改。</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/33.jpeg" alt title="图片33"></p>
<ul>
<li>效果图如下：</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/34.jpeg" alt title="图片34"></p>
<h3 id="底部隐藏由Hexo强力驱动、主题–NexT-Mist"><a href="#底部隐藏由Hexo强力驱动、主题–NexT-Mist" class="headerlink" title="底部隐藏由Hexo强力驱动、主题–NexT.Mist"></a>底部隐藏由Hexo强力驱动、主题–NexT.Mist</h3><ul>
<li>在主题文件夹下，打开 layout/_partials/footer.swig 文件，注释掉相关代码如下所示，位置是文末。</li>
</ul>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">&lt;!-- 用下面的符号注释，注释代码用下面括号括起来 --&gt;</span></span><br><span class="line"><span class="comment">&lt;!-- --&gt;</span></span><br><span class="line"></span><br><span class="line"><span class="comment">&lt;!-- </span></span><br><span class="line"><span class="comment">&#123;% if theme.footer.powered.enable %&#125;</span></span><br><span class="line"><span class="comment">  &lt;div class="powered-by"&gt;&#123;#</span></span><br><span class="line"><span class="comment">  #&#125;&#123;&#123; __('footer.powered', next_url('https://hexo.io', 'Hexo', &#123;class: 'theme-link'&#125;)) &#125;&#125;&#123;#</span></span><br><span class="line"><span class="comment">  #&#125;&#123;% if theme.footer.powered.version %&#125; v&#123;&#123; hexo_env('version') &#125;&#125;&#123;% endif %&#125;&#123;#</span></span><br><span class="line"><span class="comment"> #&#125;&lt;/div&gt;</span></span><br><span class="line"><span class="comment">&#123;% endif %&#125;</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">&#123;% if theme.footer.powered.enable and theme.footer.theme.enable %&#125;</span></span><br><span class="line"><span class="comment">  &lt;span class="post-meta-divider"&gt;|&lt;/span&gt;</span></span><br><span class="line"><span class="comment">&#123;% endif %&#125;</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">&#123;% if theme.footer.theme.enable %&#125;</span></span><br><span class="line"><span class="comment">  &lt;div class="theme-info"&gt;&#123;#</span></span><br><span class="line"><span class="comment">  #&#125;&#123;&#123; __('footer.theme') &#125;&#125; – &#123;&#123; next_url('https://theme-next.org', 'NexT.' + theme.scheme, &#123;class: 'theme-link'&#125;) &#125;&#125;&#123;#</span></span><br><span class="line"><span class="comment">  #&#125;&#123;% if theme.footer.theme.version %&#125; v&#123;&#123; version &#125;&#125;&#123;% endif %&#125;&#123;#</span></span><br><span class="line"><span class="comment">#&#125;&lt;/div&gt;</span></span><br><span class="line"><span class="comment">&#123;% endif %&#125;</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">&#123;% if theme.footer.custom_text %&#125;</span></span><br><span class="line"><span class="comment">  &lt;div class="footer-custom"&gt;&#123;#</span></span><br><span class="line"><span class="comment">  #&#125;&#123;&#123; theme.footer.custom_text &#125;&#125;&#123;#</span></span><br><span class="line"><span class="comment">#&#125;&lt;/div&gt;</span></span><br><span class="line"><span class="comment">&#123;% endif %&#125;</span></span><br></pre></td></tr></table></figure>

<h3 id="添加底部桃心"><a href="#添加底部桃心" class="headerlink" title="添加底部桃心"></a>添加底部桃心</h3><ul>
<li>在主题文件夹下，打开 layout/_partials/footer.swig 文件，搜索 <strong>with-love</strong> ，然后在 <a href="https://fontawesome.com/icons?d=gallery&q=heart" target="_blank" rel="noopener">fontawesom</a>上找到自己喜欢的图标，把代码复制到如图对应的位置。</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/35.jpeg" alt title="图片35"></p>
<ul>
<li>效果图如下：</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/36.jpeg" alt title="图片36"></p>
<h3 id="设置网站图片-Favicon"><a href="#设置网站图片-Favicon" class="headerlink" title="设置网站图片 Favicon"></a>设置网站图片 Favicon</h3><ul>
<li>在 <a href="https://www.iconfont.cn/?spm=a313x.7781069.1998910419.d4d0a486a" target="_blank" rel="noopener">阿里巴巴矢量图标库</a> 中找到自己的喜欢的图标，下载下来，覆盖掉主题文件夹下的 source/images 目录里面的三张图片即可。</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/37.jpeg" alt title="图片37"></p>
<h3 id="网页顶部进度加载条设置"><a href="#网页顶部进度加载条设置" class="headerlink" title="网页顶部进度加载条设置"></a>网页顶部进度加载条设置</h3><ul>
<li>在主题文件夹的 _config.yml 配置文件中，搜索到 <strong>pace</strong> 后，把其值改为 <strong>true</strong> 即可，然后选择一款你喜欢的样式。</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/38.jpeg" alt title="图片38"></p>
<h3 id="博客置顶设置"><a href="#博客置顶设置" class="headerlink" title="博客置顶设置"></a>博客置顶设置</h3><ul>
<li>安装插件</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">$ npm uninstall hexo-generator-index --save</span><br><span class="line">$ npm install hexo-generator-index-pin-top --save</span><br></pre></td></tr></table></figure>

<ul>
<li>然后在需要置顶的文章的 <strong>Front-matter</strong> 中加上 <strong>top</strong> 即可，数值越大表示等级越高，越靠前显示。</li>
</ul>
<figure class="highlight makefile"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">---</span><br><span class="line"><span class="section">title: this is my first blog</span></span><br><span class="line"><span class="section">date: 2019-04-14</span></span><br><span class="line"><span class="section">top: 100</span></span><br><span class="line">---</span><br></pre></td></tr></table></figure>

<ul>
<li>在主题文件夹中打开 layout/_macro/post.swig 文件，定位到 <strong>post-header</strong> ，把下面的代码添加进去即可。</li>
</ul>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">&#123;% if post.top %&#125;</span><br><span class="line">  <span class="tag">&lt;<span class="name">i</span> <span class="attr">class</span>=<span class="string">"fa fa-thumb-tack"</span>&gt;</span><span class="tag">&lt;/<span class="name">i</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">font</span> <span class="attr">color</span>=<span class="string">7D26CD</span>&gt;</span>置顶<span class="tag">&lt;/<span class="name">font</span>&gt;</span></span><br><span class="line">&#123;% endif %&#125;</span><br></pre></td></tr></table></figure>

<p><img src="http://q0sn9so75.bkt.clouddn.com/39.jpeg" alt title="图片39"></p>
<ul>
<li>重启服务，效果图如下：</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/40.jpeg" alt title="图片40"></p>
<h3 id="文末显示微信公众号设置"><a href="#文末显示微信公众号设置" class="headerlink" title="文末显示微信公众号设置"></a>文末显示微信公众号设置</h3><ul>
<li>在主题文件夹下打开 _config.yml 配置文件，定位到 <strong>wechat_subscriber</strong>，把微信公众号的二维码图片存放到项目根目录下的 source/uploads 里面（若没有 uploads 文件夹可以自己新建）。然后修改相关配置，如下代码所示：</li>
</ul>
<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># Wechat Subscriber</span></span><br><span class="line"><span class="attr">wechat_subscriber:</span></span><br><span class="line">  <span class="attr">enable:</span> <span class="literal">true</span></span><br><span class="line">  <span class="attr">qcode:</span> <span class="string">/uploads/wechat-qcode.jpg</span></span><br><span class="line">  <span class="attr">description:</span> <span class="string">欢迎您扫一扫上面的微信公众号，订阅我的博客！</span></span><br></pre></td></tr></table></figure>

<ul>
<li>效果图如下：</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/41.jpeg" alt title="图片41"></p>
<h3 id="打赏功能设置"><a href="#打赏功能设置" class="headerlink" title="打赏功能设置"></a>打赏功能设置</h3><ul>
<li>在主题文件夹下打开 _config.yml 配置文件中，定位到 reward，把微信收款码和支付宝收款码存放到项目根目录下的 source/uploads 里面（若没有 uploads 文件夹可以自己新建）。然后如下图所示修改相关配置，animation 这个字段是设置字体跳动，可以根据个人需求设置。</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/42.jpeg" alt title="图片42"></p>
<ul>
<li>效果图如下：</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/43.jpeg" alt title="图片43"></p>
<h3 id="百度分享设置"><a href="#百度分享设置" class="headerlink" title="百度分享设置"></a>百度分享设置</h3><ul>
<li>在主题文件夹下打开 _config.yml 配置文件中，定位到 <strong>baidushare</strong>，然后把对应的注释去掉。然后刷新页面即可。</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/44.jpeg" alt title="图片44"></p>
<p><img src="http://q0sn9so75.bkt.clouddn.com/45.jpeg" alt title="图片45"></p>
<h3 id="文章底部版权信息设置"><a href="#文章底部版权信息设置" class="headerlink" title="文章底部版权信息设置"></a>文章底部版权信息设置</h3><ul>
<li>在主题文件夹的 layout/_macro 目录下，新建一个 <strong>my-copyright.swig</strong> 文件，把下面的代码复制进去。</li>
</ul>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br></pre></td><td class="code"><pre><span class="line">&#123;% if page.copyright %&#125;</span><br><span class="line"><span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">"my_post_copyright"</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">script</span> <span class="attr">src</span>=<span class="string">"//cdn.bootcss.com/clipboard.js/1.5.10/clipboard.min.js"</span>&gt;</span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></span><br><span class="line">  </span><br><span class="line">  <span class="comment">&lt;!-- JS库 sweetalert 可修改路径 --&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">script</span> <span class="attr">src</span>=<span class="string">"https://cdn.bootcss.com/jquery/2.0.0/jquery.min.js"</span>&gt;</span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">script</span> <span class="attr">src</span>=<span class="string">"https://unpkg.com/sweetalert/dist/sweetalert.min.js"</span>&gt;</span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">p</span>&gt;</span><span class="tag">&lt;<span class="name">span</span>&gt;</span>本文标题:<span class="tag">&lt;/<span class="name">span</span>&gt;</span><span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">"&#123;&#123; url_for(page.path) &#125;&#125;"</span>&gt;</span>&#123;&#123; page.title &#125;&#125;<span class="tag">&lt;/<span class="name">a</span>&gt;</span><span class="tag">&lt;/<span class="name">p</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">p</span>&gt;</span><span class="tag">&lt;<span class="name">span</span>&gt;</span>文章作者:<span class="tag">&lt;/<span class="name">span</span>&gt;</span><span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">"/"</span> <span class="attr">title</span>=<span class="string">"访问 &#123;&#123; theme.author &#125;&#125; 的个人博客"</span>&gt;</span>&#123;&#123; theme.author &#125;&#125;<span class="tag">&lt;/<span class="name">a</span>&gt;</span><span class="tag">&lt;/<span class="name">p</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">p</span>&gt;</span><span class="tag">&lt;<span class="name">span</span>&gt;</span>发布时间:<span class="tag">&lt;/<span class="name">span</span>&gt;</span>&#123;&#123; page.date.format("YYYY年MM月DD日 - HH:MM") &#125;&#125;<span class="tag">&lt;/<span class="name">p</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">p</span>&gt;</span><span class="tag">&lt;<span class="name">span</span>&gt;</span>最后更新:<span class="tag">&lt;/<span class="name">span</span>&gt;</span>&#123;&#123; page.updated.format("YYYY年MM月DD日 - HH:MM") &#125;&#125;<span class="tag">&lt;/<span class="name">p</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">p</span>&gt;</span><span class="tag">&lt;<span class="name">span</span>&gt;</span>原始链接:<span class="tag">&lt;/<span class="name">span</span>&gt;</span><span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">"&#123;&#123; url_for(page.path) &#125;&#125;"</span> <span class="attr">title</span>=<span class="string">"&#123;&#123; page.title &#125;&#125;"</span>&gt;</span>&#123;&#123; page.permalink &#125;&#125;<span class="tag">&lt;/<span class="name">a</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">span</span> <span class="attr">class</span>=<span class="string">"copy-path"</span>  <span class="attr">title</span>=<span class="string">"点击复制文章链接"</span>&gt;</span><span class="tag">&lt;<span class="name">i</span> <span class="attr">class</span>=<span class="string">"fa fa-clipboard"</span> <span class="attr">data-clipboard-text</span>=<span class="string">"&#123;&#123; page.permalink &#125;&#125;"</span>  <span class="attr">aria-label</span>=<span class="string">"复制成功！"</span>&gt;</span><span class="tag">&lt;/<span class="name">i</span>&gt;</span><span class="tag">&lt;/<span class="name">span</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;/<span class="name">p</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">p</span>&gt;</span><span class="tag">&lt;<span class="name">span</span>&gt;</span>许可协议:<span class="tag">&lt;/<span class="name">span</span>&gt;</span><span class="tag">&lt;<span class="name">i</span> <span class="attr">class</span>=<span class="string">"fa fa-creative-commons"</span>&gt;</span><span class="tag">&lt;/<span class="name">i</span>&gt;</span> 转载请保留原文链接及作者。<span class="tag">&lt;/<span class="name">p</span>&gt;</span>  </span><br><span class="line"><span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">script</span>&gt;</span> </span><br><span class="line"><span class="actionscript">    <span class="keyword">var</span> clipboard = <span class="keyword">new</span> Clipboard(<span class="string">'.fa-clipboard'</span>);</span></span><br><span class="line"><span class="javascript">    $(<span class="string">".fa-clipboard"</span>).click(<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>&#123;</span></span><br><span class="line"><span class="actionscript">      clipboard.on(<span class="string">'success'</span>, <span class="function"><span class="keyword">function</span><span class="params">()</span></span>&#123;</span></span><br><span class="line">        swal(&#123;   </span><br><span class="line"><span class="actionscript">          title: <span class="string">""</span>,   </span></span><br><span class="line"><span class="actionscript">          text: <span class="string">'复制成功'</span>,</span></span><br><span class="line"><span class="actionscript">          icon: <span class="string">"success"</span>, </span></span><br><span class="line"><span class="actionscript">          showConfirmButton: <span class="literal">true</span></span></span><br><span class="line">          &#125;);</span><br><span class="line">    &#125;);</span><br><span class="line">    &#125;);  </span><br><span class="line"><span class="tag">&lt;/<span class="name">script</span>&gt;</span></span><br><span class="line">&#123;% endif %&#125;</span><br></pre></td></tr></table></figure>

<ul>
<li>在主题文件夹的 source/css/_common/components/post/ 目录下，新建一个 <strong>my-post-copyright.styl</strong> 添加如下代码。</li>
</ul>
<figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-class">.my_post_copyright</span> &#123;</span><br><span class="line">  <span class="attribute">width</span>: <span class="number">85%</span>;</span><br><span class="line">  <span class="attribute">max-width</span>: <span class="number">45em</span>;</span><br><span class="line">  <span class="attribute">margin</span>: <span class="number">2.8em</span> auto <span class="number">0</span>;</span><br><span class="line">  <span class="attribute">padding</span>: <span class="number">0.5em</span> <span class="number">1.0em</span>;</span><br><span class="line">  <span class="attribute">border</span>: <span class="number">1px</span> solid <span class="number">#d3d3d3</span>;</span><br><span class="line">  <span class="attribute">font-size</span>: <span class="number">0.93rem</span>;</span><br><span class="line">  <span class="attribute">line-height</span>: <span class="number">1.6em</span>;</span><br><span class="line">  <span class="attribute">word-break</span>: break-all;</span><br><span class="line">  <span class="attribute">background</span>: <span class="built_in">rgba</span>(255,255,255,0.4);</span><br><span class="line">&#125;</span><br><span class="line"><span class="selector-class">.my_post_copyright</span> <span class="selector-tag">p</span>&#123;<span class="attribute">margin</span>:<span class="number">0</span>;&#125;</span><br><span class="line"><span class="selector-class">.my_post_copyright</span> <span class="selector-tag">span</span> &#123;</span><br><span class="line">  <span class="attribute">display</span>: inline-block;</span><br><span class="line">  <span class="attribute">width</span>: <span class="number">5.2em</span>;</span><br><span class="line">  <span class="attribute">color</span>: <span class="number">#b5b5b5</span>;</span><br><span class="line">  <span class="attribute">font-weight</span>: bold;</span><br><span class="line">&#125;</span><br><span class="line"><span class="selector-class">.my_post_copyright</span> <span class="selector-class">.raw</span> &#123;</span><br><span class="line">  <span class="attribute">margin-left</span>: <span class="number">1em</span>;</span><br><span class="line">  <span class="attribute">width</span>: <span class="number">5em</span>;</span><br><span class="line">&#125;</span><br><span class="line"><span class="selector-class">.my_post_copyright</span> <span class="selector-tag">a</span> &#123;</span><br><span class="line">  <span class="attribute">color</span>: <span class="number">#808080</span>;</span><br><span class="line">  <span class="attribute">border-bottom</span>:<span class="number">0</span>;</span><br><span class="line">&#125;</span><br><span class="line"><span class="selector-class">.my_post_copyright</span> <span class="selector-tag">a</span><span class="selector-pseudo">:hover</span> &#123;</span><br><span class="line">  <span class="attribute">color</span>: <span class="number">#a3d2a3</span>;</span><br><span class="line">  <span class="attribute">text-decoration</span>: underline;</span><br><span class="line">&#125;</span><br><span class="line"><span class="selector-class">.my_post_copyright</span><span class="selector-pseudo">:hover</span> <span class="selector-class">.fa-clipboard</span> &#123;</span><br><span class="line">  <span class="attribute">color</span>: <span class="number">#000</span>;</span><br><span class="line">&#125;</span><br><span class="line"><span class="selector-class">.my_post_copyright</span> <span class="selector-class">.post-url</span><span class="selector-pseudo">:hover</span> &#123;</span><br><span class="line">  <span class="attribute">font-weight</span>: normal;</span><br><span class="line">&#125;</span><br><span class="line"><span class="selector-class">.my_post_copyright</span> <span class="selector-class">.copy-path</span> &#123;</span><br><span class="line">  <span class="attribute">margin-left</span>: <span class="number">1em</span>;</span><br><span class="line">  <span class="attribute">width</span>: <span class="number">1em</span>;</span><br><span class="line">  +mobile()&#123;display:none;&#125;</span><br><span class="line">&#125;</span><br><span class="line"><span class="selector-class">.my_post_copyright</span> <span class="selector-class">.copy-path</span><span class="selector-pseudo">:hover</span> &#123;</span><br><span class="line">  <span class="attribute">color</span>: <span class="number">#808080</span>;</span><br><span class="line">  <span class="attribute">cursor</span>: pointer;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<ul>
<li>打开主题文加下的 layout/_macro/post.swig 文件，找到如图所示的位置添加上下面这段代码。</li>
</ul>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">div</span>&gt;</span></span><br><span class="line">      &#123;% if not is_index %&#125;</span><br><span class="line">        &#123;% include 'my-copyright.swig' %&#125;</span><br><span class="line">      &#123;% endif %&#125;</span><br><span class="line"><span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br></pre></td></tr></table></figure>

<p><img src="http://q0sn9so75.bkt.clouddn.com/46.jpeg" alt title="图片46"></p>
<ul>
<li>打开项目根目录下的 source/css/_common/components/post/post.styl 文件，在文末加上这句代码：</li>
</ul>
<figure class="highlight stylus"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">@import <span class="string">"my-post-copyright"</span></span><br></pre></td></tr></table></figure>

<ul>
<li>在 Markdown 文章中加入 <strong>copyright : ture</strong></li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/47.jpeg" alt title="图片47"></p>
<ul>
<li>配置项目根目录下的 _config.yml 文件，此处配置会在第四章节，对接远程仓库（码农）的时候讲到，我们到这里还是用本的本地服务器进行测试，所以不用修改，默认就行。</li>
</ul>
<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># URL</span></span><br><span class="line"><span class="comment">## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'</span></span><br><span class="line"><span class="attr">url:</span> <span class="string">http://yoursite.com</span></span><br><span class="line"><span class="attr">root:</span> <span class="string">/</span></span><br><span class="line"><span class="attr">permalink:</span> <span class="string">:year/:month/:day/:title/</span></span><br><span class="line"><span class="attr">permalink_defaults:</span></span><br></pre></td></tr></table></figure>

<ul>
<li>刷新页面或重启服务后，可以在文章尾部看到如下效果图：</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/48.jpeg" alt title="图片48"></p>
<p>###文章代码主题设置</p>
<ul>
<li><p>NexT 使用 Tomorrow Theme 作为代码高亮，共有5款主题供你选择。 NexT 默认使用的是 白色的 normal 主题，可选的值有 <strong>normal，night， night blue， night bright， night eighties</strong>。</p>
</li>
<li><p>在主题文件夹的 _config.yml 配置文件中，定位到 <strong>highlight_theme</strong>，根据需求修改相应的值即可。</p>
</li>
</ul>
<h3 id="文末标签样式设置"><a href="#文末标签样式设置" class="headerlink" title="文末标签样式设置"></a>文末标签样式设置</h3><ul>
<li>打开主题文件夹下的 layout_macro\post.swig 文件，搜索 rel=“tag”&gt;#，将#替换成****。然后需要关闭服务器，先把原来的静态资源给清除掉，重启服务才能看到效果。</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">$ hexo clean</span><br><span class="line">$ hexo s</span><br></pre></td></tr></table></figure>

<p><img src="http://q0sn9so75.bkt.clouddn.com/49.jpeg" alt title="图片49"></p>
<h3 id="网站底部字数统计设置"><a href="#网站底部字数统计设置" class="headerlink" title="网站底部字数统计设置"></a>网站底部字数统计设置</h3><ul>
<li>在项目根目录下安装 hexo 插件。</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ npm install hexo-wordcount --save</span><br></pre></td></tr></table></figure>

<ul>
<li>打开主题文件夹下的 layout/_partials/footer.swig 文件，在文末添加上下面这段代码。</li>
</ul>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">"theme-info"</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">"powered-by"</span>&gt;</span><span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">span</span> <span class="attr">class</span>=<span class="string">"post-count"</span>&gt;</span>博客全站共&#123;&#123; totalcount(site) &#125;&#125;字<span class="tag">&lt;/<span class="name">span</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br></pre></td></tr></table></figure>

<ul>
<li>刷新页面查看效果图，如下：</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/50.jpeg" alt title="图片50"></p>
<h3 id="网站底部加上访问量"><a href="#网站底部加上访问量" class="headerlink" title="网站底部加上访问量"></a>网站底部加上访问量</h3><ul>
<li><p>已经在（网站底部字数统计设置） 这一节安装了相关插件，所以不需要再安装了。</p>
</li>
<li><p>打开主题文件夹下的 layout/_partials/footer.swig 文件，在文末添加如下代码，位置如下图所示：</p>
</li>
</ul>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">script</span> <span class="attr">async</span> <span class="attr">src</span>=<span class="string">"//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"</span>&gt;</span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></span><br><span class="line"></span><br><span class="line"><span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">"powered-by"</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">i</span> <span class="attr">class</span>=<span class="string">"fa fa-user-md"</span>&gt;</span><span class="tag">&lt;/<span class="name">i</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">span</span> <span class="attr">id</span>=<span class="string">"busuanzi_container_site_pv"</span>&gt;</span></span><br><span class="line">    本站访问量:<span class="tag">&lt;<span class="name">span</span> <span class="attr">id</span>=<span class="string">"busuanzi_value_site_pv"</span>&gt;</span><span class="tag">&lt;/<span class="name">span</span>&gt;</span>次</span><br><span class="line">  <span class="tag">&lt;/<span class="name">span</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">span</span> <span class="attr">class</span>=<span class="string">"post-meta-divider"</span>&gt;</span>|<span class="tag">&lt;/<span class="name">span</span>&gt;</span></span><br><span class="line">  <span class="tag">&lt;<span class="name">span</span> <span class="attr">id</span>=<span class="string">"busuanzi_container_site_uv"</span>&gt;</span></span><br><span class="line">    本站总访客量：<span class="tag">&lt;<span class="name">span</span> <span class="attr">id</span>=<span class="string">"busuanzi_value_site_uv"</span>&gt;</span><span class="tag">&lt;/<span class="name">span</span>&gt;</span>人</span><br><span class="line">  <span class="tag">&lt;/<span class="name">span</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">div</span>&gt;</span></span><br></pre></td></tr></table></figure>

<p><img src="http://q0sn9so75.bkt.clouddn.com/51.jpeg" alt title="图片51"></p>
<ul>
<li>效果图如下：</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/52.jpeg" alt title="图片52"></p>
<h3 id="外链网易云音乐设置"><a href="#外链网易云音乐设置" class="headerlink" title="外链网易云音乐设置"></a>外链网易云音乐设置</h3><ul>
<li>打开<a href="https://music.163.com/" target="_blank" rel="noopener">网易云</a>，登录自己的账号，选择自己喜欢的一首歌，然后点击“生成外链播放器”，如下图所示</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/53.jpeg" alt title="图片53"></p>
<ul>
<li>根据自己的需求设置音乐的样式，然后把代码复制下来。</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/54.jpeg" alt title="图片54"></p>
<ul>
<li>打开主题文件夹下的 layout/_macro/sidebar.swig 文件，自己找个合适的位置，把刚刚复制的代码放进去。我放置的位置如下图所示。</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/55.jpeg" alt title="图片55"></p>
<ul>
<li>需要重启服务才能看到效果，效果图如下所示。</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/56.jpeg" alt title="图片56"></p>
<h3 id="文章内链接文本样式设置"><a href="#文章内链接文本样式设置" class="headerlink" title="文章内链接文本样式设置"></a>文章内链接文本样式设置</h3><ul>
<li>打开主题文件夹下的 source\css_common\components\post\post.styl 文件，然后在文末加上下面这段代码即可。</li>
</ul>
<figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">// 文章内链接文本样式</span><br><span class="line"><span class="selector-class">.post-body</span> <span class="selector-tag">p</span> <span class="selector-tag">a</span>&#123;</span><br><span class="line">  color: #0593d3; //原始链接颜色</span><br><span class="line">  <span class="selector-tag">border-bottom</span>: <span class="selector-tag">none</span>;</span><br><span class="line">  border-bottom: 1px solid #0593d3; //底部分割线颜色</span><br><span class="line">  &amp;<span class="selector-pseudo">:hover</span> &#123;</span><br><span class="line">    color: #fc6423; //鼠标经过颜色</span><br><span class="line">    <span class="selector-tag">border-bottom</span>: <span class="selector-tag">none</span>;</span><br><span class="line">    border-bottom: 1px solid #fc6423; //底部分割线颜色</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h3 id="文章显示阅读数量设置"><a href="#文章显示阅读数量设置" class="headerlink" title="文章显示阅读数量设置"></a>文章显示阅读数量设置</h3><ul>
<li>在主题文件下的 _config.yml 配置文件中，定位到 <strong>busuanzi_count</strong>，把 <strong>enable</strong> 的值修改为 <strong>true</strong>。</li>
</ul>
<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># Show Views / Visitors of the website / page with busuanzi.</span></span><br><span class="line"><span class="comment"># Get more information on http://ibruce.info/2015/04/04/busuanzi</span></span><br><span class="line"><span class="attr">busuanzi_count:</span></span><br><span class="line">  <span class="attr">enable:</span> <span class="literal">true</span></span><br><span class="line">  <span class="attr">total_visitors:</span> <span class="literal">true</span></span><br><span class="line">  <span class="attr">total_visitors_icon:</span> <span class="string">user</span></span><br><span class="line">  <span class="attr">total_views:</span> <span class="literal">true</span></span><br><span class="line">  <span class="attr">total_views_icon:</span> <span class="string">eye</span></span><br><span class="line">  <span class="attr">post_views:</span> <span class="literal">true</span></span><br><span class="line">  <span class="attr">post_views_icon:</span> <span class="string">eye</span></span><br></pre></td></tr></table></figure>

<h3 id="评论模块接入"><a href="#评论模块接入" class="headerlink" title="评论模块接入"></a>评论模块接入</h3><ul>
<li>我使用的是来必里云跟帖功能来设置评论模块。</li>
<li>首先得先到 <a href="https://www.livere.com/" target="_blank" rel="noopener">来必里</a> 申请一个账号。</li>
<li>点击右上角的头像，进入“管理页面”，会看到“您确定要获得来必力安装代码吗?”的提示，直接点击“实行”即可</li>
<li>申请 City 免费版，如实填写信息即可。申请成功后，可以看到“一般网站”下的第二行代码，有个 data-uid，把后面的值复制下来留着备用。</li>
<li>在主题文件下打开 _config.yml 配置文件，定位到 livere_uid，把刚刚拷贝的data-uid粘贴到相应的位置。</li>
</ul>
<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># LiveRe comments system</span></span><br><span class="line"><span class="comment"># You can get your uid from https://livere.com/insight/myCode (General web site)</span></span><br><span class="line"><span class="attr">livere_uid:</span> <span class="string">MTAyM8888888888DI3OQ==</span></span><br></pre></td></tr></table></figure>

<ul>
<li>重新部署就能看到相应的效果：</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/57.jpeg" alt title="图片57"></p>
<h2 id="对接码云的远程仓库"><a href="#对接码云的远程仓库" class="headerlink" title="对接码云的远程仓库"></a>对接码云的远程仓库</h2><ul>
<li>在码云上创建一个公有仓库，并把公有仓库的链接保存下来。</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/58.jpeg" alt title="图片58"></p>
<ul>
<li><p>打开项目根目录下的 _config.yml 配置文件，修改 <strong>deploy</strong> 的值。<strong>tpye</strong> 设置为 <strong>git</strong>，<strong>repo</strong> 则设置为刚刚新建的远程仓库链接。</p>
</li>
<li><p><font color="red">注意：冒号后面需要再加一个空格，不然会出现格式错误。</font></p>
</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/59.jpeg" alt title="图片59"></p>
<ul>
<li>在项目根目录下，打开 Git Bash，配置码云的用户和邮箱。</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">$ git config --global user.name空格+你的码云的名字</span><br><span class="line">$ git config --global user.email空格+你的码云的邮箱</span><br></pre></td></tr></table></figure>

<ul>
<li>安装hexo-deployer-git，安装成功图如下：</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ npm install hexo-deployer-git --save</span><br></pre></td></tr></table></figure>

<p><img src="http://q0sn9so75.bkt.clouddn.com/60.jpeg" alt title="图片60"></p>
<ul>
<li>一键部署到远程仓库，部署成功图如下：</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">$ hexo g</span><br><span class="line">$ hexo deploy</span><br></pre></td></tr></table></figure>

<p><img src="http://q0sn9so75.bkt.clouddn.com/61.jpeg" alt title="图片61"></p>
<ul>
<li>回到刚刚新建的远程仓库，刷新页面，可以发现本地博客的相关文件已经全部部署到远程仓库上了。</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/62.jpeg" alt title="图片62"></p>
<ul>
<li>配置免费域名</li>
<li>在项目首页 -&gt; 服务 -&gt; Gitee Pages</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/63.jpeg" alt title="图片63"></p>
<ul>
<li>第一次用的用户，需要先绑定手机。</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/64.jpeg" alt title="图片64"></p>
<ul>
<li>绑定手机后重新进入，选择对应的分支，然后点击部署。等待之后，就会生成对应的访问连接。如下图所示。</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/65.jpeg" alt title="图片65"></p>
<ul>
<li>点击 Gitee Pages 生成的网站地址，即可远程访问自己的个人博客，但是，我们会发现博客上的样式都没有。</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/66.jpeg" alt title="图片66"></p>
<ul>
<li>打开项目根目录下的 _config.yml 文件，修改 URL 部分的参数。</li>
<li><strong>url</strong> 字段的值修改为远程访问连接</li>
<li><strong>root</strong> 字段的值修改 /+远程仓库的名称</li>
</ul>
<p><img src="http://q0sn9so75.bkt.clouddn.com/67.jpeg" alt title="图片67"></p>
<ul>
<li>重新部署</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">$ hexo clean</span><br><span class="line">$ hexo g</span><br><span class="line">$ hexo d</span><br></pre></td></tr></table></figure>



<p><strong>本文参考链接</strong><br><a href="https://www.jianshu.com/p/13f5e4d7099d" target="_blank" rel="noopener">https://www.jianshu.com/p/13f5e4d7099d</a></p>
<p><a href="http://theme-next.iissnan.com/theme-settings.html#rss" target="_blank" rel="noopener">http://theme-next.iissnan.com/theme-settings.html#rss</a></p>
<p><a href="https://www.jianshu.com/p/9f0e90cc32c2" target="_blank" rel="noopener">https://www.jianshu.com/p/9f0e90cc32c2</a></p>
<p><a href="https://www.simon96.online/2018/10/12/hexo-tutorial" target="_blank" rel="noopener">https://www.simon96.online/2018/10/12/hexo-tutorial</a></p>

    </div>

    
    
    

    <div>
      
        
<div class="my_post_copyright">
  <script src="//cdn.bootcss.com/clipboard.js/1.5.10/clipboard.min.js"></script>
  
  <!-- JS库 sweetalert 可修改路径 -->
  <script src="https://cdn.bootcss.com/jquery/2.0.0/jquery.min.js"></script>
  <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
  <p><span>本文标题:</span><a href="/website/2019/11/07/1/">码云 + Hexo 搭建个人博客</a></p>
  <p><span>文章作者:</span><a href="/" title="访问 徐良军 的个人博客">徐良军</a></p>
  <p><span>发布时间:</span>2019年11月07日 - 17:11</p>
  <p><span>最后更新:</span>2019年11月15日 - 15:11</p>
  <p><span>原始链接:</span><a href="/website/2019/11/07/1/" title="码云 + Hexo 搭建个人博客">https://ahxuliangjun.gitee.io/website/2019/11/07/1/</a>
    <span class="copy-path"  title="点击复制文章链接"><i class="fa fa-clipboard" data-clipboard-text="https://ahxuliangjun.gitee.io/website/2019/11/07/1/"  aria-label="复制成功！"></i></span>
  </p>
  <p><span>许可协议:</span><i class="fa fa-creative-commons"></i> 转载请保留原文链接及作者。</p>  
</div>
<script> 
    var clipboard = new Clipboard('.fa-clipboard');
    $(".fa-clipboard").click(function(){
      clipboard.on('success', function(){
        swal({   
          title: "",   
          text: '复制成功',
          icon: "success", 
          showConfirmButton: true
          });
    });
    });  
</script>

      
    </div>
      
        <div class="reward-container">
  <div></div>
  <button disable="enable" onclick="var qr = document.getElementById(&quot;qr&quot;); qr.style.display = (qr.style.display === 'none') ? 'block' : 'none';">
    打赏
  </button>
  <div id="qr" style="display: none;">
      
      <div style="display: inline-block;">
        <img src="/website/images/wechatpay.jpeg" alt="徐良军 微信支付">
        <p>微信支付</p>
      </div>
      
      <div style="display: inline-block;">
        <img src="/website/images/alipay.jpeg" alt="徐良军 支付宝">
        <p>支付宝</p>
      </div>

  </div>
</div>


      <footer class="post-footer">
          
          <div class="post-tags">
              <a href="/website/tags/%E5%BB%BA%E7%AB%99-%E5%88%9B%E5%BB%BA%E5%8D%9A%E5%AE%A2/" rel="tag"><i class="fa fa-tag"></i> -建站 -创建博客</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-next post-nav-item">
            </div>

            <span class="post-nav-divider"></span>

            <div class="post-nav-prev post-nav-item">
                <a href="/website/2019/11/15/2/" rel="prev" title="PaddlePaddle实现线性回归">
                  PaddlePaddle实现线性回归 <i class="fa fa-chevron-right"></i>
                </a>
            </div>
          </div>
      </footer>
    
  </article>
  
  
  

  </div>


          </div>
          
    
  <div class="comments" id="comments">
    <div id="lv-container" data-id="city" data-uid="MTAyMC80NzQxNi8yMzkxNg=="></div>
  </div>
  

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#准备环境"><span class="nav-number">1.</span> <span class="nav-text">准备环境</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#生成静态页面"><span class="nav-number">1.1.</span> <span class="nav-text">生成静态页面</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#启动本地服务"><span class="nav-number">1.2.</span> <span class="nav-text">启动本地服务</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#美化个人博客"><span class="nav-number">2.</span> <span class="nav-text">美化个人博客</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#博客主题设置"><span class="nav-number">2.1.</span> <span class="nav-text">博客主题设置</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#克隆主题"><span class="nav-number">2.1.1.</span> <span class="nav-text">克隆主题</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#配置主题"><span class="nav-number">2.1.2.</span> <span class="nav-text">配置主题</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#测试主题"><span class="nav-number">2.1.3.</span> <span class="nav-text">测试主题</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#发布文章"><span class="nav-number">2.1.4.</span> <span class="nav-text">发布文章</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#博客左侧栏设置"><span class="nav-number">2.2.</span> <span class="nav-text">博客左侧栏设置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#分类设置"><span class="nav-number">2.3.</span> <span class="nav-text">分类设置</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#添加分类列表"><span class="nav-number">2.3.1.</span> <span class="nav-text">添加分类列表</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#如何将文章添加到对应分类？"><span class="nav-number">2.3.2.</span> <span class="nav-text">如何将文章添加到对应分类？</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#标签设置"><span class="nav-number">2.4.</span> <span class="nav-text">标签设置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Hexo-博客添加站内搜索"><span class="nav-number">2.5.</span> <span class="nav-text">Hexo 博客添加站内搜索</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#博客头像设置"><span class="nav-number">2.6.</span> <span class="nav-text">博客头像设置</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#添加博客头像"><span class="nav-number">2.6.1.</span> <span class="nav-text">添加博客头像</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#设置头像圆角并旋转打开"><span class="nav-number">2.6.2.</span> <span class="nav-text">设置头像圆角并旋转打开</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#右上角-fork-me-设置"><span class="nav-number">2.7.</span> <span class="nav-text">右上角 fork me 设置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#网页背景设置"><span class="nav-number">2.8.</span> <span class="nav-text">网页背景设置</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#动态背景设置"><span class="nav-number">2.8.1.</span> <span class="nav-text">动态背景设置</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#背景图片设置"><span class="nav-number">2.8.2.</span> <span class="nav-text">背景图片设置</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#点击出现桃心效果设置"><span class="nav-number">2.9.</span> <span class="nav-text">点击出现桃心效果设置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#首页文章预览设置"><span class="nav-number">2.10.</span> <span class="nav-text">首页文章预览设置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#RSS-设置"><span class="nav-number">2.11.</span> <span class="nav-text">RSS 设置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#社交小图标设置"><span class="nav-number">2.12.</span> <span class="nav-text">社交小图标设置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#友情链接设置"><span class="nav-number">2.13.</span> <span class="nav-text">友情链接设置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#底部隐藏由Hexo强力驱动、主题–NexT-Mist"><span class="nav-number">2.14.</span> <span class="nav-text">底部隐藏由Hexo强力驱动、主题–NexT.Mist</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#添加底部桃心"><span class="nav-number">2.15.</span> <span class="nav-text">添加底部桃心</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#设置网站图片-Favicon"><span class="nav-number">2.16.</span> <span class="nav-text">设置网站图片 Favicon</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#网页顶部进度加载条设置"><span class="nav-number">2.17.</span> <span class="nav-text">网页顶部进度加载条设置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#博客置顶设置"><span class="nav-number">2.18.</span> <span class="nav-text">博客置顶设置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#文末显示微信公众号设置"><span class="nav-number">2.19.</span> <span class="nav-text">文末显示微信公众号设置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#打赏功能设置"><span class="nav-number">2.20.</span> <span class="nav-text">打赏功能设置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#百度分享设置"><span class="nav-number">2.21.</span> <span class="nav-text">百度分享设置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#文章底部版权信息设置"><span class="nav-number">2.22.</span> <span class="nav-text">文章底部版权信息设置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#文末标签样式设置"><span class="nav-number">2.23.</span> <span class="nav-text">文末标签样式设置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#网站底部字数统计设置"><span class="nav-number">2.24.</span> <span class="nav-text">网站底部字数统计设置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#网站底部加上访问量"><span class="nav-number">2.25.</span> <span class="nav-text">网站底部加上访问量</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#外链网易云音乐设置"><span class="nav-number">2.26.</span> <span class="nav-text">外链网易云音乐设置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#文章内链接文本样式设置"><span class="nav-number">2.27.</span> <span class="nav-text">文章内链接文本样式设置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#文章显示阅读数量设置"><span class="nav-number">2.28.</span> <span class="nav-text">文章显示阅读数量设置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#评论模块接入"><span class="nav-number">2.29.</span> <span class="nav-text">评论模块接入</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#对接码云的远程仓库"><span class="nav-number">3.</span> <span class="nav-text">对接码云的远程仓库</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <img class="site-author-image" itemprop="image" alt="徐良军"
    src="https://himg.bdimg.com/sys/portrait/item/pp.1.d8a0b964.z9ewrAT61w4xKYPMXSO_9g?_t=1573118862410">
  <p class="site-author-name" itemprop="name">徐良军</p>
  <div class="site-description" itemprop="description">故其疾如风，其徐如林，侵掠如火，不动如山</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/website/archives/">
        
          <span class="site-state-item-count">3</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/website/categories/">
          
        <span class="site-state-item-count">3</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
        <span class="site-state-item-count">3</span>
        <span class="site-state-item-name">标签</span>
      </div>
  </nav>
</div>
  <div class="feed-link motion-element">
    <a href="/website/atom.xml" rel="alternate">
      <i class="fa fa-rss"></i>RSS
    </a>
  </div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://gitee.com/ahxuliangjun" title="Git &amp;rarr; https:&#x2F;&#x2F;gitee.com&#x2F;ahxuliangjun" rel="noopener" target="_blank"><i class="fa fa-fw fa-github"></i>Git</a>
      </span>
      <span class="links-of-author-item">
        <a href="http://wpa.qq.com/msgrd?v=3&uin=690242231&site=qq&menu=yes" title="QQ &amp;rarr; http:&#x2F;&#x2F;wpa.qq.com&#x2F;msgrd?v=3&amp;uin=690242231&amp;site=qq&amp;menu=yes" rel="noopener" target="_blank"><i class="fa fa-fw fa-qq"></i>QQ</a>
      </span>
      <span class="links-of-author-item">
        <a href="/website/mailto:690242231@qq.com" title="E-Mail &amp;rarr; mailto:690242231@qq.com" rel="noopener" target="_blank"><i class="fa fa-fw fa-envelope"></i>E-Mail</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://weibo.com/u/1548377403" title="Weibo &amp;rarr; https:&#x2F;&#x2F;weibo.com&#x2F;u&#x2F;1548377403" rel="noopener" target="_blank"><i class="fa fa-fw fa-weibo"></i>Weibo</a>
      </span>
  </div>


  <div class="links-of-blogroll motion-element">
    <div class="links-of-blogroll-title">
      <i class="fa fa-fw fa-link"></i>
      友情连接
    </div>
    <ul class="links-of-blogroll-list">
        <li class="links-of-blogroll-item">
          <a href="https://www.oschina.net/" title="https:&#x2F;&#x2F;www.oschina.net&#x2F;" rel="noopener" target="_blank">开源中国</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://www.baidu.com/" title="https:&#x2F;&#x2F;www.baidu.com" rel="noopener" target="_blank">百度</a>
        </li>
    </ul>
  </div>

      </div>
      
      <iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=330 height=86 src="//music.163.com/outchain/player?type=2&id=167850&auto=1&height=66"></iframe>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-angellist"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">徐良军</span>
  <span><i class="fa fa-user"></i></span>
  <span> 博客全站共8.7k字</span>
  
  <!--
  <script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
  <i class="fa fa-user-md"></i>
  <span id="busuanzi_container_site_pv">
    本站访问量:<span id="busuanzi_value_site_pv"></span>次
  </span>
  <span class="post-meta-divider">|</span>
  <span id="busuanzi_container_site_uv">
    本站总访客量：<span id="busuanzi_value_site_uv"></span>人
  </span>
  -->
</div>
<!-- 用下面的符号注释，注释代码用下面括号括起来 -->
<!-- -->
<!--
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> 强力驱动 v4.0.0
  </div>
  <span class="post-meta-divider">|</span>
  <div class="theme-info">主题 – <a href="https://theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> v7.5.0
  </div>
-->
  <div class="addthis_inline_share_toolbox">
    <script src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5dc7a702c422599d" async="async"></script>
  </div>

        












        
      </div>
    </footer>
  </div>

  
  <script src="/website/lib/anime.min.js"></script>
  <script src="/website/lib/velocity/velocity.min.js"></script>
  <script src="/website/lib/velocity/velocity.ui.min.js"></script>
<script src="/website/js/utils.js"></script><script src="/website/js/motion.js"></script>
<script src="/website/js/schemes/pisces.js"></script>
<script src="/website/js/next-boot.js"></script>



  
  <script>
    (function(){
      var bp = document.createElement('script');
      var curProtocol = window.location.protocol.split(':')[0];
      bp.src = (curProtocol === 'https') ? 'https://zz.bdstatic.com/linksubmit/push.js' : 'http://push.zhanzhang.baidu.com/push.js';
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(bp, s);
    })();
  </script>




  <script src="/website/js/local-search.js"></script>













  

  

<script>
  window.livereOptions = {
    refer: location.pathname.replace(CONFIG.root, '').replace('index.html', '')
  };
  (function(d, s) {
    var j, e = d.getElementsByTagName(s)[0];
    if (typeof LivereTower === 'function') { return; }
    j = d.createElement(s);
    j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
    j.async = true;
    e.parentNode.insertBefore(j, e);
  })(document, 'script');
</script>

</body>
</html>
<!-- 动态背景 -->
<script type="text/javascript" src="//cdn.bootcss.com/canvas-nest.js/1.0.0/canvas-nest.min.js"></script>
<!-- 页面点击小红心 -->
<script type="text/javascript" src="https://ahxuliangjun.gitee.io/website/js/src/clicklove.js"></script>

<!-- -->
<!-- weather js -->
<div id="tp-weather-widget"></div>
<script>
  (function(a,h,g,f,e,d,c,b){b=function(){d=h.createElement(g);c=h.getElementsByTagName(g)[0];d.src=e;d.charset="utf-8";d.async=1;c.parentNode.insertBefore(d,c)};a["SeniverseWeatherWidgetObject"]=f;a[f]||(a[f]=function(){(a[f].q=a[f].q||[]).push(arguments)});a[f].l=+new Date();if(a.attachEvent){a.attachEvent("onload",b)}else{a.addEventListener("load",b,false)}}(window,document,"script","SeniverseWeatherWidget","//cdn.sencdn.com/widget2/static/js/bundle.js?t="+parseInt((new Date().getTime() / 100000000).toString(),10)));
  window.SeniverseWeatherWidget('show', {
    flavor: "bubble",
    location: "WTW3SJ5ZBJUY",
    geolocation: true,
    language: "zh-Hans",
    unit: "c",
    theme: "dark",
    token: "762787a3-c72c-414e-995d-b44bfcd6b5e0",
    hover: "enabled",
    container: "tp-weather-widget"
  })
</script>
